package logic

import (
	"context"
	"video-manager/model/mysql"

	"video-manager/usersrpc/internal/svc"
	"video-manager/usersrpc/usersrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CollectionListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCollectionListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CollectionListLogic {
	return &CollectionListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CollectionListLogic) CollectionList(in *usersrpc.CollectionListRequest) (*usersrpc.CollectionListResponse, error) {
	// todo: add your logic here and delete this line

	var list []*usersrpc.CollectionList
	list = mysql.CollectionList(mysql.DB, in, list)
	return &usersrpc.CollectionListResponse{
		List: list,
	}, nil
}
